from insts.inst import NoOperandInstruction


class MONITOR_ENTER(NoOperandInstruction):
    def execute(self, frame):
        ref = frame.getOperandStack().popRef()
        if ref is None:
            raise RuntimeError("NullPointerException")


class MONITOR_EXIT(NoOperandInstruction):
    def execute(self, frame):
        ref = frame.getOperandStack().popRef()
        if ref is None:
            raise RuntimeError("NullPointerException")
